<?php
mysql_select_db($database_drycleaners_conn, $drycleaners_conn);
$query_get_loggedin_user = "SELECT branch.name as branch_name,
       person.first_name,
       person.last_name,
       user.username,
       role.name as role_name
  FROM    (   (   (   drycleaners.user user
                   INNER JOIN
                      drycleaners.person person
                   ON (user.person_id = person.id))
               LEFT OUTER JOIN
                  drycleaners.user_branch user_branch
               ON (user_branch.user_id = user.id))
           LEFT OUTER JOIN
              drycleaners.branch branch
           ON (user_branch.branch_id = branch.id))
       INNER JOIN
          drycleaners.role role
       ON (user.role_id = role.id)
Where user.id='".$_SESSION['user_id']."'
";
$get_loggedin_user = mysql_query($query_get_loggedin_user, $drycleaners_conn) or die(mysql_error());
$row_get_loggedin_user = mysql_fetch_assoc($get_loggedin_user);
$totalRows_get_loggedin_user = mysql_num_rows($get_loggedin_user);
 session_start();
$loggedin_id=$_SESSION['user_id'];
?>